<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>{$current['title']}-{$Think.CONFIG.sitename}</title>

    <link href="__PUBLIC__/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/animate.min.css" rel="stylesheet">
    <include file="Public/commoncss" />
    <!-- Sweet Alert -->
    <link href="__PUBLIC__/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>

<body class="gray-bg top-navigation">
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom white-bg">
            <include file="Public/header" />
        </div>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <include file="Public/deptnav" />
                    </div>
                </div>
                <div class="col-sm-9 animated fadeInRight">
                    <div class="mail-box-header">

                        <form method="get" action="" class="pull-right mail-search">
                            <div class="input-group">
                                <input type="text" class="form-control input-sm" name="keyword" placeholder="搜索动态标题，正文等" value="{$_GET['keyword']}">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-sm btn-primary">
                                        搜索
                                    </button>
                                </div>
                            </div>
                        </form>
                        <h2>
                            所有动态列表
                        </h2>
                        <div class="mail-tools tooltip-demo m-t-md">

                            <button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="left" title="刷新列表" onclick="window.location.href='{:U('index')}'"><i class="fa fa-refresh"></i> 刷新</button>
                            <button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="删除" id="del"><i class="fa fa-trash-o"></i></button>

                        </div>
                    </div>
                    <div class="mail-box">

                        <table class="table table-hover table-mail">
                            <tbody>
                            <volist name="list" id="vo">
                                <tr <if condition="$i%2">class="unread" <else /> class="read"</if>>
                                <td class="check-mail">
                                    <input type="checkbox" class="i-checks" name="ids[]" value="{$vo.id}">
                                </td>
                                <td class="mail-subject"><a href="{:U('view')}?sid={$vo.id}">[{$vo.source|getNewsType}] {$vo.title|SearchWords=$_GET['keyword']}</a></td>
                                <td class="mail-ontact"><if condition="$vo['pin']"><i class="fa fa-key"></i> 【{$vo.pin}】</if> </td>
                                <td class="text-right mail-date">{$vo.uname} 发布于:{$vo.time|beenTime}</td>

                                </tr>
                            </volist>


                            </tbody>
                        </table>
                    </div>
                    {$page}
                </div>
            </div>
        </div>
        <include file="Public/footer" />
    </div>
</div>
<include file="Public/commonjs" />
<script src="__PUBLIC__/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__PUBLIC__/static/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/static/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script>
    $(document).ready(function() {
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        })

        $('#del').click(function () {
            var data = getJson('ids[]');
            swal({
                title:"您确定删除这个动态吗",
                text: "删除后将不可以恢复！",
                type: "info",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                cancelButtonText:"取消",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function () {
                $.post("{:U('del')}",{ids:data},function(data){
                    if(data.status !== 'y'){
                        swal('操作失败!',data.info, "warning");
                    }else{
                        window.location.reload();
                    }
                });
            });
        });

    });
</script>

</body>

</html>